package com.objectimprove;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        //键盘输入
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三角形的三边");

        Triangle triangle = new Triangle();
        //校验
        if (!triangle.isValidTriangle(sc.nextDouble(), sc.nextDouble(), sc.nextDouble())) {
            System.err.println("您输入的三角形无效");
            return;
        }
        System.out.println("该三角形的信息如下:");
        System.out.println("周长为：" + triangle.getPerimeter());
        System.out.println("面积为： + " + triangle.getArea());
    }


}
